<style type="text/css">
    .focus-trigeminy-group{padding: 9px;}
    h5{font-size: 13px;color: #0099CC;}
    .focus-trigeminy-group ul{font-size: 0;overflow: hidden;}
    .focus-trigeminy-group ul li{background-color: #FFF;letter-spacing: normal;word-spacing: normal;vertical-align: top;display: inline-block;padding: 4px;margin:11px;border: dashed 1px #DDD;cursor: e-resize;}
    .full-screen-slides ul li .del, .focus-trigeminy-group .del, .sale-layout dl .del{font: 10px/14px Tahoma;font-size: 18px;color: #19AEDE;text-align: center;background-color: #FFF;display: none;width: 20px;height: 20px;border: solid 1px #19AEDE;border-radius: 10px;position: absolute;z-index: 1;top: -10px;right: -5px;cursor: pointer;}
    .focus-trigeminy-group ul li .focus-thumb{line-height: 0;text-align: center;vertical-align: middle;display: table-cell;width: 200px;height: 200px;overflow: hidden;cursor: pointer;}
    .focus-trigeminy-group ul li img{ width: 100%;height: 100%}
    #SearchGoods{position: fixed;top: 25%;width: 620px;left: 50%;margin-left: -325px;border:5px solid rgba(148, 148, 148, 0.45);border-radius: 5px;max-height: 440px;overflow: auto;}
    .focus-trigeminy-group ul{padding-top: 10px;}
    .focus-trigeminy-group ul li{position: relative;overflow: initial;}
    .focus-trigeminy-group ul li p{width: 96%;margin: 0 2%;left: 0;font-size: 14px;position: absolute;bottom: 3px;background: rgba(0, 0, 0, 0.5);color: #fff;line-height: 24px;height: 24px;overflow: hidden;}
    .focus-trigeminy-group:hover .del{display: none;}
    .focus-trigeminy-group ul li:hover .del{display: block;}
    .add_goods ul li:hover .del{display: none;}
    .del_he{font-size: 14px;color: #19AEDE;text-align: center;background-color: #FFF;width: 20px;height: 20px;border: solid 1px rgba(148, 148, 148, 0.45);position: absolute;z-index: 1;top: 3px;right: 3px;cursor: pointer;}
    .input_small{width: 125px;}
</style>

<form name="myfrom" id="myform" method="post" action="">
<div class="admin">
    <div class="tab panel dux-box admin-panel">
        <div class="panel-head"><strong>推荐位管理</strong></div>
        <div class="padding border-bottom">
            <foreach name="position" item="v">
                <if condition="($position_id eq $v['position_id'])">
                    <a class="button button-small bg-green text-white" href="{:U('index',array('position_id'=>$v['position_id']))}" id="{$v['position_id']}">{$v['position_name']}</a>
                    <else />
                    <a class="button button-small border-green" href="{:U('index',array('position_id'=>$v['position_id']))}" id="{$v['position_id']}">{$v['position_name']}</a>
                </if>
            </foreach>
        </div>
        <div class="panel-head"><input type="button" class="button bg-main" value="添加商品" id="tianjia_goods" ajax="{:U('Web/addGoods')}" /></div>
        <div class="focus-trigeminy-group delete_goods">
            <ul class="ui-sortable">
                <foreach name="recommend" item="v">
                    <li pic_id="{$v['goods']['goods_id']}">
                        <a class="del" rid ="{$v['recommend_id']}" title="删除">x</a>
                        <div class="focus-thumb"><img title="{$v['goods']['goods_title']}" src="{$v['goods']['goods_thumb']}"></div>
                        <p>{$v['goods']['goods_title']}</p>
                    </li>
                </foreach>
            </ul>
        </div>
    </div>
</div>
</form>
<script type="text/javascript">
    $('#tianjia_goods').on('click',function(){
        layer.open({
          type: 2,
          area: ['700px', '530px'],
          fixed: false, //不固定
          maxmin: true,
          title:'选择商品框',
          content: "{:U('Index/addGoods',array('position_id'=>$position_id))}"
        });
    });
    
    $(document).on('click','.del',function(){
        var recommend_id = $(this).attr('rid');
        var data = {recommend_id:recommend_id};
        p = Aajax("{:U('/Web/delGoods')}", data);
        if(p.status){
            $(this).parent().hide();
        }else{
            layer.msg(p.msg);
        }
    })
</script>